package com.zatech.cgnci.project.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zatech.cgnci.project.base.utils.ConvertUtils;
import com.zatech.cgnci.project.entity.CgnciExchangeRateDO;
import com.zatech.cgnci.project.mapper.CgnciExchangeRateMapper;
import com.zatech.cgnci.project.service.CgnciExchangeRateService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zatech.cgnci.project.vo.CgnciExchangeRateVO;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 币种汇率表 服务实现类
 * </p>
 *
 * @author Generator
 * @since 2024-12-17
 */
@Service
public class CgnciExchangeRateServiceImpl extends ServiceImpl<CgnciExchangeRateMapper, CgnciExchangeRateDO> implements CgnciExchangeRateService {

    @Override
    public List<CgnciExchangeRateVO> listExchangeRateByInsuranceId(Long insuranceId) {
        List<CgnciExchangeRateDO> exchangeRateList = this.list(new LambdaQueryWrapper<CgnciExchangeRateDO>()
                .eq(CgnciExchangeRateDO::getBusinessId, insuranceId));
        return ConvertUtils.convert(exchangeRateList, CgnciExchangeRateVO.class);
    }
}
